#ifndef __ALBUM_PANO_H__
#define __ALBUM_PANO_H__

#include "sqlite3.h"
#include "common_info.h"

#include <ctime>
#include <vector>
#include <string>


// typedef struct {
//     std::string file_path;              //全景文件夹，以最高分辨率为准
//     std::time_t modification_time;
//     std::string thumbnail_path;
//     std::string file_size;
//     int row;
//     int col;
// } PanoInfo;

typedef struct {
    int code;
    int row;
    int col;
} concatenate_result;


class AlbumPano {
public:
    AlbumPano();
    ~AlbumPano();

    int createPanoInfoTable(sqlite3* db);
    int insertPanoInfo(const PanoInfo& pano_info);
    std::vector<PanoInfo> queryPanoInfoByTime();
    std::vector<PanoInfo> queryAllPanoInfo();
    std::vector<PanoInfo> queryPanoInfoByFilepath(const std::string& file_path);
    bool updatePanoInfo(const std::string& file_path, const std::string& new_filename);
    bool deletePanoInfo(const std::string& file_path);
    void printPanoInfo(const PanoInfo& pano_info);
    concatenate_result concatenateImages(const std::string& input_folder, const std::string& output_image_path);
    int getCount();
    std::vector<PanoInfo> queryPanoInfoByTime(int page, int items_per_page);
    bool deleteDirectory(const std::string& file_path);
    bool renameDirectory(const std::string& file_path, const std::string& new_astro_name);
    int updatePano(const std::string& folder_path, int rows, int cols);

private:
    static bool compareFilenames(const std::string& a, const std::string& b);
};



#endif